#ifndef RAYCASTCONTROLLER_H
#define RAYCASTCONTROLLER_H

#include <QObject>
#include <box2d/b2_world_callbacks.h>
#include <QDebug>
#include <box2d/b2_fixture.h>

class RayCastController : public QObject,public b2RayCastCallback
{
    Q_OBJECT
public:
    explicit RayCastController(QObject *parent = nullptr);
    float ReportFixture(b2Fixture* fixture, const b2Vec2& point,const b2Vec2& normal, float fraction) override;
    ///判断p1的 攻击范围中是否有p2,p2的攻击范围中是否有p1
    bool area(QString name);
private:
    ///当p2进入p1攻击范围时为true,否则为false
    bool p1Area;
    ///当p1进入p2攻击范围时为true,否则为false;
    bool p2Area;
signals:



};

#endif // RAYCASTCONTROLLER_H
